package Final;

import java.util.Scanner;

public class test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Object []obj = new Object[n];
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            switch (s){
                case "c":{
                    Computer computer = new Computer();
                    obj[i] = computer;
                    break;
                }
                case "d":{
                    double d = sc.nextDouble();
                    obj[i] = d;
                    break;
                }
                case "i":{
                    int a = sc.nextInt();
                    obj[i] = a;
                    break;
                }
                case "s":{
                    String b = sc.next();
                    obj[i] = b;
                    break;
                }
                default:{
                    obj[i] = null;
                    break;
                }
            }
        }
        for (int i = obj.length - 1; i >= 0; i--) {
            if (obj[i] != null){
                System.out.println(obj[i]);
            }
        }
    }
}
class Computer{
    @Override
    public String toString() {
        return "帅哥";
    }
}
